package com.guoxin.principle.di;

public class DependencyInversion {

    public static void main(String[] args) {
        Person p = new Person();
        p.receive(new Email());
    }
}

class Email {

    public String getInfo() {
        return "电子邮件信息：hello world";
    }
}

class Person {

    public void receive(Email e) {
        System.out.println(e.getInfo());
    }
}
